package backOffice;

import java.sql.Connection;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;

public class Connexion {	
	public Context namingContext;
	public DataSource dataSource; 
	public Connection con;	
	public Connexion() {			
		try {
			namingContext = new InitialContext();
			dataSource = (DataSource)namingContext.lookup("java:comp/env/jdbc/schoolDatasource");
			con = dataSource.getConnection();
			System.out.println("Succes");			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			System.out.println("Fail");
		}		
	}
}
